package com.ocom.mysql.aspect;


import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Administrator
 */
@Documented
@Retention(RUNTIME)
@Target({METHOD, PARAMETER})
public @interface DataSourceAspect {
    //主库分库
    DataSourceEnum type() default DataSourceEnum.MAIN_DB;

    //主从切换
    MasterSlaveEnum isMaster() default MasterSlaveEnum.MASTER;

    String companyId() default "companyId";

}
